<include file="public@header"/>
<span class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('Web/webTestList')}">站点列表</a></li>
        <li><a href="{:url('Web/webExchangeList')}">站点转换记录</a></li>
        <li><a href="{:url('Web/add')}">添加站点</a></li>
        <li><a href="{:url('Web/exchange')}">站点转换</a></li>
        <li><a href="{:url('Web/copy')}">复制站点</a></li>
    </ul>
    <form action="{:url('Web/webTestList')}" method="post" class="form-horizontal js-ajax-form margin-top-20" style="width:50%; float:left;">
        <div class="row">
            <div class="col-md-3" style="width:50%;">
                <table class="table table-bordered">
                    <input class="form-control" type="text" name="server_name" required placeholder="请输入站点域名">
                </table>
            </div>
            <button type="submit" class="btn btn-primary" style="float:left;">搜索</button>
            <p style='margin-top: 7px;'><b style='margin-left: 20px;color: red;'><?php if (isset($webNumber)) {echo '站点数:'.$webNumber;}?></b></p>
        </div>
    </form>
    <?php
        if(isset($page)) {
            echo "<div class='pagination' style='float:right;'>".$list->render()."</div>";
        }
    ?>
<div class="row">
    <div class="col-md-12">
        <table class="table table-hover table-bordered">
            <thead>
            <tr>
                <th>ID</th>
                <th>域名</th>
                <th>站点状态</th>
                <th>能否复制</th>
                <th>管理员</th>
                <th>创建时间</th>
                <th>更新时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="list" item="vo">
                <tr>
                    <td>{$vo.id}</td>
                    <td>{$vo.server_name}</td>
                    <td>{$vo.status == 1 ? '<b style="color: green">测试站点</b>' : '<b style="color: red">僵尸站点</b>'}</td>
                    <td><?php if($vo['copy_status'] == 1) {
                                echo '<b style="color: green">是</b>';
                        } elseif ($vo['copy_status'] == 2) {
                        echo '<b style="color: red">否</b>';
                        } else {
                        echo '<b style="color: orange">待测</b>';
                        }
                        ?>
                    </td>
                    <td>{$vo.admin_name}</td>
                    <td>{$vo.created_at}</td>
                    <td>{$vo.updated_at}</td>
                    <td><?php if($vo['status'] == 1) {
                            echo '<a style="text-decoration:none; color:green" href="' . 'saveWebStatus?id=' . $vo['id'] . '"' . '><strong>置空</strong></a>&nbsp;&nbsp;';
                        }?>
                        <?php if($vo['copy_status'] == 0 || $vo['copy_status'] == 2) {
                            echo ' <a style="text-decoration:none; color:green" href="' . 'replicable?id=' . $vo['id'] . '"' . '>
                            <strong>可复制</strong></a>&nbsp;&nbsp;';
                        }?>
                        <?php  if($vo['copy_status'] == 0 || $vo['copy_status'] == 1) {
                            echo ' <a style="text-decoration:none; color:green" href="' . 'noReplicable?id=' . $vo['id'] . '"' . '>
                            <strong>不可复制</strong></a>&nbsp;&nbsp;';
                        }?>
                    </td>
                </tr>
            </foreach>
            </tbody>
        </table>
    </div>
</div>
<?php
    if(isset($page)) {
        echo "<div class='pagination' style='float:right;'>".$list->render()."</div>";
    }
?>
</div>
